sub Connected {
  my $self = shift;
  print( " ~ Connected Successfully!\n\n" );
  $msn->setDisplayPicture($config->{dispic});
}

sub Message {
  my ($self, $user, $name, $msg, %style) = @_;
  $email = $user;
  if (exists $session->{$email}) {
    $user = $session->{$email};
  }
  else {
    $user = "guest";
  }
  &command($self, $user, $name, $email, $msg, %style);
  local $Data::Dumper::Varname = "Configuration";
  open (FILE, ">$confdir/settings.dump");
  print FILE Dumper($config);
  close FILE;
  
  local $Data::Dumper::Varname = "Users";
  open (FILE, ">$confdir/users.dump");
  print FILE Dumper($users);
  close FILE;
  
  print " ~ $user:\n\t + $msg\n\n";
}

sub WelcomeMessage {
  my ($self, $user, $name) = @_;
    if (exists $session->{$email}) {
    $user = $session->{$email};
  }
  else {
    $user = "guest";
  }
  if ($user eq 'guest') {
    $self->sendMessage("Type !login <username> <password> to login, or !register <username> <password> to register.");
  }
  else {
    $self->sendMessage("Hey, $user!");
  }
}